/**
 * @file contbtsys_ds.hpp
 * @brief Data structures for the contbtsys project
 * @date 2024-2-26
 * @version 0.0.1
 * 
*/

#ifndef __CONTBTSYS_DS_HPP__
#define __CONTBTSYS_DS_HPP__

#include <string>
#include <memory>
#include <iostream>

namespace ContBTSys {

enum ActionType {
    OBSERVATION,
    ACTUATION
};
class Action;
using RootPtr = std::shared_ptr<Action>;
using ActionPtr = std::shared_ptr<Action>;

/**
 * @brief The class for the action node in the contingent planning tree. 
 * It can be an **observation** or an **actuation** node. 
 * If it is an observation node, it has a true son and a false son. 
 * If it is an actuation node, it has a son.
 * 
*/
class Action {
    public:
        Action(std::string name, ActionType type) : name_(name), type_(type) {
            son = nullptr;
            true_son = nullptr;
            false_son = nullptr;
        }
        virtual ~Action() {}
        
        /**
         * @brief Get the name of the action
        */
        std::string get_name() {
            return name_;
        }

        /**
         * @brief Set the name of the action
        */
        void set_name(std::string name) {
            name_ = name;
        }

        /**
         * @brief Get the type of the action, observation or actuation
        */
        ActionType get_type() {
            return type_;
        }

        ActionPtr son;
        ActionPtr true_son;
        ActionPtr false_son;

    private:
        std::string name_;
        ActionType type_;
};


} // namespace ContBTSys

#endif // __CONTBTSYS_DS_HPP__